package com.bifrost.entity;

import java.io.Serializable;
import javax.persistence.*;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.List;


/**
 * The persistent class for the PRODUCT_OPTION_VALUE database table.
 */
@Entity
@Table(name = "PRODUCT_OPTION_VALUE",indexes = {
        @Index(name = "PRODUCT_OPTION_ID_INDEX",columnList = "PRODUCT_OPTION_ID",unique = false)
})
@NamedQuery(name = "ProductOptionValue.findAll", query = "SELECT p FROM ProductOptionValue p")
public class ProductOptionValue implements Serializable {
    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "PRODUCT_OPTION_VALUE_ID", unique = true, nullable = false)
    private Long productOptionValueId;

    @Column(name = "ATTRIBUTE_VALUE", length = 255)
    private String attributeValue;

    @Column(name = "DISPLAY_ORDER")
    private BigInteger displayOrder;

    @Column(name = "PRICE_ADJUSTMENT", precision = 10, scale = 5)
    private BigDecimal priceAdjustment;

    //bi-directional many-to-one association to ProductOption
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "PRODUCT_OPTION_ID" ,foreignKey = @ForeignKey(name = "none", value = ConstraintMode.NO_CONSTRAINT))
    private ProductOption productOption;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "PRODUCT_ID" ,foreignKey = @ForeignKey(name = "none", value = ConstraintMode.NO_CONSTRAINT))
    private Product product;

    @OneToMany(mappedBy = "productOptionValue")
    @org.hibernate.annotations.ForeignKey(name = "none")
    private List<SkuOptionValue> skuOptionValues;

    public ProductOptionValue() {
    }

    public Long getProductOptionValueId() {
        return this.productOptionValueId;
    }

    public void setProductOptionValueId(Long productOptionValueId) {
        this.productOptionValueId = productOptionValueId;
    }

    public String getAttributeValue() {
        return this.attributeValue;
    }

    public void setAttributeValue(String attributeValue) {
        this.attributeValue = attributeValue;
    }

    public BigInteger getDisplayOrder() {
        return this.displayOrder;
    }

    public void setDisplayOrder(BigInteger displayOrder) {
        this.displayOrder = displayOrder;
    }

    public BigDecimal getPriceAdjustment() {
        return this.priceAdjustment;
    }

    public void setPriceAdjustment(BigDecimal priceAdjustment) {
        this.priceAdjustment = priceAdjustment;
    }

    public ProductOption getProductOption() {
        return this.productOption;
    }

    public void setProductOption(ProductOption productOption) {
        this.productOption = productOption;
    }

    public List<SkuOptionValue> getSkuOptionValues() {
        return skuOptionValues;
    }

    public void setSkuOptionValues(List<SkuOptionValue> skuOptionValues) {
        this.skuOptionValues = skuOptionValues;
    }

    public Product getProduct() {
        return product;
    }

    public void setProduct(Product product) {
        this.product = product;
    }
}